﻿using AuthCenter.Api.Write.Application.Command.RoleMenu;
using AuthCenter.ErrorCode;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace AuthCenter.Api.Write.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class RoleMenuController : ControllerBase
    {
        private readonly IMediator mediator;
        public RoleMenuController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 添加角色菜单
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public Task<ApiResult<int>> AddRoleMenu(AddRoleMenuCommand request) 
        {
            return mediator.Send(request);
        }
    }
}
